import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  List<String> bannerList = [
    "https://upload-images.jianshu.io/upload_images/972352-84d6c7a71620be2d?imageMogr2/auto-orient/strip|imageView2/2/w/640/format/webp",
    "https://upload-images.jianshu.io/upload_images/972352-84d6c7a71620be2d?imageMogr2/auto-orient/strip|imageView2/2/w/640/format/webp",
    "https://upload-images.jianshu.io/upload_images/972352-84d6c7a71620be2d?imageMogr2/auto-orient/strip|imageView2/2/w/640/format/webp",
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          Container(
            height: 160,
            child: Swiper(
              itemCount: bannerList.length,
              autoplay: true,
              itemBuilder: (BuildContext context, int index) {
                return Image.network(
                  bannerList[index],
                  fit: BoxFit.fill,
                );
              },
              pagination: SwiperPagination(),
            ),
          ),
          Text('test')
        ],
      ),
    );
  }
}
